Windows Hello for Business diagnostics and management.
| Path | Purpose |
|---|---|
Invoke-WHFBAudit.ps1 |
Diagnostic auditor. Captures all 12 data points needed to triage recurring PIN failures and produces a self-contained HTML report. Diagnosis only — no remediation. |
Enable-WindowsHello.ps1 |
Configures the PassportForWork policy and other registry values to enable WHFB on a workstation. |
Remove-NgcContainer.ps1 |
WHFB Step 2 remediation. Clears the corrupt NGC / Microsoft Passport container for the signed-in user (certutil -deleteHelloContainer). Designed to be deployed via Intune as a user-context PowerShell script after the WHFB-disable policy has applied. Includes pre-state dump, transcript logging, and an explicit Win11 passkey-wipe caveat in the header. |
docs/ |
Reference documentation — see below. |
WHFB-Remediation-AppReg/ |
Remediation automation. Cert-auth Entra app registration (12 Graph perms, 24h ephemeral cert) plus 14 Python scripts that create the unassigned remediation objects in Intune — security group, Endpoint Security Account-Protection policy disabling WHFB, Settings Catalog policy enabling security-key sign-in, additive Web Sign-In policy, and the user-context PowerShell script that clears the NGC container. See the folder README. |
Archive/ |
Older / deprecated artifacts kept for historical reference. Includes the v0.1.0 WHfB-Diagnostics module (superseded by Invoke-WHFBAudit.ps1 — see its CHANGELOG). |
docs/audit-tool.md— full operator guide forInvoke-WHFBAudit.ps1: parameters, where to run, how to read the reportdocs/root-causes.md— the nine documented root-cause classes for cyclical WHFB PIN failures, with fingerprints and remediation contextdocs/diagnostic-flow.md— manual 12-step capture procedure for cases where running the auditor is not possible
Run on the affected workstation, as the affected user, ideally elevated, before any destructive PIN reset:
git clone https://github.com/aollivierre/WindowsHello.git
cd WindowsHello
.\Invoke-WHFBAudit.ps1
# Open the HTML report under .\Reports\ — start with the executive summary and class rankingTypical run takes 8–15 seconds and produces a single self-contained HTML report (~30–80 KB) plus a raw-dump folder.
Shared workstation with more than one affected user? A single run captures per-user data for the running user only. See Shared PCs / multiple affected users below — the audit will warn you when it detects other Entra profiles on the device that weren't audited.
.\Enable-WindowsHello.ps1 # requires elevationThe audit splits into two halves:
| Scope | What is captured | What you must do |
|---|---|---|
| Device-wide (one run per device covers everyone) | Event logs (HelloForBusiness/Operational, User Device Registration, AAD/Operational, Crypto-NCrypt, Application 7055/7703, KDC, TPM-WMI), dsregcmd /status, Get-Tpm, network reachability, OS / hotfix inventory. |
Run once on the device. |
| Per-user (scoped to the user the script runs as) | NGC keys via certutil -csp "Microsoft Passport Key Storage Provider" -key, UPN drift via whoami /upn, HKCU PassportForWork policy registry tree, the executive-summary User: line. |
Run once for each affected user while signed in as that user. |
On a shared PC (e.g. a front-desk machine where both admin-cci@… and reservations@… see the PIN failure), a single run is not sufficient evidence for the per-user findings — it only proves the corruption for whoever launched the script. The dsregcmd, event-log, and TPM signals reflect everyone, but the headline "No Microsoft Passport KSP keys for current user" / certutil output / HKCU-policy tree do not.
The auditor now detects this: Step 0a enumerates HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList, filters to Entra-joined local profiles (S-1-12-1-* SIDs under C:\Users\), and emits a WARN finding listing the other profiles when the audit was launched as only one of several Entra users on the device. The executive-summary User: line is your scope indicator.
Recommended workflow on a shared PC:
- Sign in as the first affected user → run
.\Invoke-WHFBAudit.ps1→ save the HTML. - Sign out, sign in as the next affected user → run again → save that HTML alongside.
- Compare the per-user "NGC keys" and HKCU-policy sections across the reports; device-wide sections will be identical.
- Windows 10 / 11 with PowerShell 5.1 (the inbox version)
- The audit tool needs no external modules for the workstation run
- AD module / RSAT only required for
msDS-KeyCredentialLinklookups (Key Trust drift detection) - Domain controller scope: run the audit tool elevated on a DC for the KDC operational log + AD attribute checks
Invoke-WHFBAudit.ps1 automates the 12-step diagnostic flow and tags each finding with one of the nine root-cause classes:
- Environment, OS build (24H2/25H2), WHFB-relevant hotfix inventory (KB5060842, KB5062553, KB5065789, etc.)
dsregcmd /status— full parse + PRT freshness check + trust-model inference- HelloForBusiness/Operational events (5001, 5002, 8200/8202/8203, 7054/7055/7201/7204)
- User Device Registration/Admin events (300, 360, 362, 363)
- AAD/Operational events with AADSTS code extraction and tally
- Crypto-NCrypt errors fingerprinted against
0x80090010,0x80090011,0x80090016,0xC000005E,0xC000006D - Application log 7055 + 7703 — the smoking-gun fingerprint for the KB5060842/KB5062553 user-scope bug
- KDC operational events 21/45/107 and
AllowNtAuthPolicyBypass(CVE-2025-26647) — DC only Get-Tpmlockout/firmware state + TPM-WMI System events- NGC keys via
certutilwith UPN-drift detection againstwhoami /upn msDS-KeyCredentialLinkcount andkrbtgt_AzureADpresence (Key Trust drift / Cloud Kerberos Trust verification)- WHFB policy registry tree — GPO vs MDM duplication detection,
UseCloudTrustForOnPremAuth,UseCertificateForOnPremAuth - Defender ASR rules (LSASS rule
9e6c4e1f-…) and AV path exclusions - Network reachability of
login.microsoftonline.com,enterpriseregistration.windows.net, etc.
For most hybrid environments, migrating to Cloud Kerberos Trust eliminates 60–70% of the recurring PIN failure modes (Class 1 Key Trust drift and Class 5 CVE-2025-26647 NTAuth fragility). It is Microsoft's recommended deployment model since 2024 and is exposed directly in the Intune Settings Catalog. See docs/root-causes.md for the full rationale.
| Platform | Audit tool | Enable script | Module |
|---|---|---|---|
| Windows 10 (1809+) | Yes | Yes | Yes |
| Windows 11 22H2/23H2 | Yes | Yes | Yes |
| Windows 11 24H2 (build 26100) | Yes — flags missing KB5065789 | Yes | Yes |
| Windows 11 25H2 (build 26200) | Yes | Yes | Yes |
| Windows Server 2016/2019/2022 (DCs) | Yes — adds DC-side KDC + AD checks | N/A | N/A |
The audit report contains hostname, username, UPN, tenant ID, device ID, build numbers, and event-log snippets. It does not contain plaintext passwords, PINs, private keys, or recovery keys. Treat the report as internal IT troubleshooting data — sanitize tenant ID and device ID before posting publicly.
Issues and pull requests welcome. For changes to the audit tool, please run it on a representative test machine and attach the report (or a screenshot of the executive summary) to the PR.
MIT (see LICENSE if present).
Abdullah Ollivierre — initial work and ongoing maintenance.
- Microsoft Learn known-issue documentation (KB5060842, WI1121302, CVE-2025-26647)
- Microsoft Q&A community threads on hybrid Key Trust drift
- MVP write-ups: Rudy Ooms, Sander Berkouwer, Joey Verlinden, Rahul Jindal, MSEndpointMgr, Awakecoding